import React from 'react'
import { ExclamationCircleOutlined } from '@ant-design/icons'
// antd现在已经内部实现了懒加载,所以我们自己不需要处理了
import { Button, Modal } from 'antd'

// 注意一定要引入app.css.因为里面引入了antd.css
import './App.less'
const { confirm } = Modal

const showConfirm = () => {
  confirm({
    title: 'Do you Want to delete these items?',
    icon: <ExclamationCircleOutlined />,
    content: 'Some descriptions',
    onOk() {
      console.log('OK')
    },
    onCancel() {
      console.log('Cancel')
    },
  })
}

export default function App() {
  return (
    <div>
      App
      {/* primary 是当前antd中的主题颜色 */}
      <Button type="primary" onClick={showConfirm}>
        Confirm
      </Button>
    </div>
  )
}
